Optimal. Leaf size=159 \[ \frac {17 a^3 x}{128}-\frac {4 a^3 \cos ^5(c+d x)}{5 d}+\frac {5 a^3 \cos ^7(c+d x)}{7 d}-\frac {a^3 \cos ^9(c+d x)}{9 d}+\frac {17 a^3 \cos (c+d x) \sin (c+d x)}{128 d}+\frac {17 a^3 \cos ^3(c+d x) \sin (c+d x)}{192 d}-\frac {17 a^3 \cos ^5(c+d x) \sin (c+d x)}{48 d}-\frac {3 a^3 \cos ^5(c+d x) \sin ^3(c+d x)}{8 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.22, antiderivative size = 159, normalized size of antiderivative = 1.00, number of steps
used = 17, number of rules used = 7, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.241, Rules used = {2952, 2648,
2715, 8, 2645, 14, 276} \begin {gather*} -\frac {a^3 \cos ^9(c+d x)}{9 d}+\frac {5 a^3 \cos ^7(c+d x)}{7 d}-\frac {4 a^3 \cos ^5(c+d x)}{5 d}-\frac {3 a^3 \sin ^3(c+d x) \cos ^5(c+d x)}{8 d}-\frac {17 a^3 \sin (c+d x) \cos ^5(c+d x)}{48 d}+\frac {17 a^3 \sin (c+d x) \cos ^3(c+d x)}{192 d}+\frac {17 a^3 \sin (c+d x) \cos (c+d x)}{128 d}+\frac {17 a^3 x}{128} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 14
Rule 276
Rule 2645
Rule 2648
Rule 2715
Rule 2952
Rubi steps
\begin {align*} \int \cos ^4(c+d x) \sin ^2(c+d x) (a+a \sin (c+d x))^3 \, dx &=\int \left (a^3 \cos ^4(c+d x) \sin ^2(c+d x)+3 a^3 \cos ^4(c+d x) \sin ^3(c+d x)+3 a^3 \cos ^4(c+d x) \sin ^4(c+d x)+a^3 \cos ^4(c+d x) \sin ^5(c+d x)\right ) \, dx\\ &=a^3 \int \cos ^4(c+d x) \sin ^2(c+d x) \, dx+a^3 \int \cos ^4(c+d x) \sin ^5(c+d x) \, dx+\left (3 a^3\right ) \int \cos ^4(c+d x) \sin ^3(c+d x) \, dx+\left (3 a^3\right ) \int \cos ^4(c+d x) \sin ^4(c+d x) \, dx\\ &=-\frac {a^3 \cos ^5(c+d x) \sin (c+d x)}{6 d}-\frac {3 a^3 \cos ^5(c+d x) \sin ^3(c+d x)}{8 d}+\frac {1}{6} a^3 \int \cos ^4(c+d x) \, dx+\frac {1}{8} \left (9 a^3\right ) \int \cos ^4(c+d x) \sin ^2(c+d x) \, dx-\frac {a^3 \text {Subst}\left (\int x^4 \left (1-x^2\right )^2 \, dx,x,\cos (c+d x)\right )}{d}-\frac {\left (3 a^3\right ) \text {Subst}\left (\int x^4 \left (1-x^2\right ) \, dx,x,\cos (c+d x)\right )}{d}\\ &=\frac {a^3 \cos ^3(c+d x) \sin (c+d x)}{24 d}-\frac {17 a^3 \cos ^5(c+d x) \sin (c+d x)}{48 d}-\frac {3 a^3 \cos ^5(c+d x) \sin ^3(c+d x)}{8 d}+\frac {1}{8} a^3 \int \cos ^2(c+d x) \, dx+\frac {1}{16} \left (3 a^3\right ) \int \cos ^4(c+d x) \, dx-\frac {a^3 \text {Subst}\left (\int \left (x^4-2 x^6+x^8\right ) \, dx,x,\cos (c+d x)\right )}{d}-\frac {\left (3 a^3\right ) \text {Subst}\left (\int \left (x^4-x^6\right ) \, dx,x,\cos (c+d x)\right )}{d}\\ &=-\frac {4 a^3 \cos ^5(c+d x)}{5 d}+\frac {5 a^3 \cos ^7(c+d x)}{7 d}-\frac {a^3 \cos ^9(c+d x)}{9 d}+\frac {a^3 \cos (c+d x) \sin (c+d x)}{16 d}+\frac {17 a^3 \cos ^3(c+d x) \sin (c+d x)}{192 d}-\frac {17 a^3 \cos ^5(c+d x) \sin (c+d x)}{48 d}-\frac {3 a^3 \cos ^5(c+d x) \sin ^3(c+d x)}{8 d}+\frac {1}{16} a^3 \int 1 \, dx+\frac {1}{64} \left (9 a^3\right ) \int \cos ^2(c+d x) \, dx\\ &=\frac {a^3 x}{16}-\frac {4 a^3 \cos ^5(c+d x)}{5 d}+\frac {5 a^3 \cos ^7(c+d x)}{7 d}-\frac {a^3 \cos ^9(c+d x)}{9 d}+\frac {17 a^3 \cos (c+d x) \sin (c+d x)}{128 d}+\frac {17 a^3 \cos ^3(c+d x) \sin (c+d x)}{192 d}-\frac {17 a^3 \cos ^5(c+d x) \sin (c+d x)}{48 d}-\frac {3 a^3 \cos ^5(c+d x) \sin ^3(c+d x)}{8 d}+\frac {1}{128} \left (9 a^3\right ) \int 1 \, dx\\ &=\frac {17 a^3 x}{128}-\frac {4 a^3 \cos ^5(c+d x)}{5 d}+\frac {5 a^3 \cos ^7(c+d x)}{7 d}-\frac {a^3 \cos ^9(c+d x)}{9 d}+\frac {17 a^3 \cos (c+d x) \sin (c+d x)}{128 d}+\frac {17 a^3 \cos ^3(c+d x) \sin (c+d x)}{192 d}-\frac {17 a^3 \cos ^5(c+d x) \sin (c+d x)}{48 d}-\frac {3 a^3 \cos ^5(c+d x) \sin ^3(c+d x)}{8 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.65, size = 106, normalized size = 0.67 \begin {gather*} \frac {a^3 (30240 c+42840 d x-52920 \cos (c+d x)-16800 \cos (3 (c+d x))+4032 \cos (5 (c+d x))+2340 \cos (7 (c+d x))-140 \cos (9 (c+d x))+5040 \sin (2 (c+d x))-12600 \sin (4 (c+d x))-1680 \sin (6 (c+d x))+945 \sin (8 (c+d x)))}{322560 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.32, size = 216, normalized size = 1.36
method | result | size |
risch | \(\frac {17 a^{3} x}{128}-\frac {21 a^{3} \cos \left (d x +c \right )}{128 d}-\frac {a^{3} \cos \left (9 d x +9 c \right )}{2304 d}+\frac {3 a^{3} \sin \left (8 d x +8 c \right )}{1024 d}+\frac {13 a^{3} \cos \left (7 d x +7 c \right )}{1792 d}-\frac {a^{3} \sin \left (6 d x +6 c \right )}{192 d}+\frac {a^{3} \cos \left (5 d x +5 c \right )}{80 d}-\frac {5 a^{3} \sin \left (4 d x +4 c \right )}{128 d}-\frac {5 a^{3} \cos \left (3 d x +3 c \right )}{96 d}+\frac {a^{3} \sin \left (2 d x +2 c \right )}{64 d}\) | \(158\) |
derivativedivides | \(\frac {a^{3} \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{5}\left (d x +c \right )\right )}{6}+\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{24}+\frac {d x}{16}+\frac {c}{16}\right )+3 a^{3} \left (-\frac {\left (\sin ^{2}\left (d x +c \right )\right ) \left (\cos ^{5}\left (d x +c \right )\right )}{7}-\frac {2 \left (\cos ^{5}\left (d x +c \right )\right )}{35}\right )+3 a^{3} \left (-\frac {\left (\sin ^{3}\left (d x +c \right )\right ) \left (\cos ^{5}\left (d x +c \right )\right )}{8}-\frac {\sin \left (d x +c \right ) \left (\cos ^{5}\left (d x +c \right )\right )}{16}+\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{64}+\frac {3 d x}{128}+\frac {3 c}{128}\right )+a^{3} \left (-\frac {\left (\sin ^{4}\left (d x +c \right )\right ) \left (\cos ^{5}\left (d x +c \right )\right )}{9}-\frac {4 \left (\sin ^{2}\left (d x +c \right )\right ) \left (\cos ^{5}\left (d x +c \right )\right )}{63}-\frac {8 \left (\cos ^{5}\left (d x +c \right )\right )}{315}\right )}{d}\) | \(216\) |
default | \(\frac {a^{3} \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{5}\left (d x +c \right )\right )}{6}+\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{24}+\frac {d x}{16}+\frac {c}{16}\right )+3 a^{3} \left (-\frac {\left (\sin ^{2}\left (d x +c \right )\right ) \left (\cos ^{5}\left (d x +c \right )\right )}{7}-\frac {2 \left (\cos ^{5}\left (d x +c \right )\right )}{35}\right )+3 a^{3} \left (-\frac {\left (\sin ^{3}\left (d x +c \right )\right ) \left (\cos ^{5}\left (d x +c \right )\right )}{8}-\frac {\sin \left (d x +c \right ) \left (\cos ^{5}\left (d x +c \right )\right )}{16}+\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{64}+\frac {3 d x}{128}+\frac {3 c}{128}\right )+a^{3} \left (-\frac {\left (\sin ^{4}\left (d x +c \right )\right ) \left (\cos ^{5}\left (d x +c \right )\right )}{9}-\frac {4 \left (\sin ^{2}\left (d x +c \right )\right ) \left (\cos ^{5}\left (d x +c \right )\right )}{63}-\frac {8 \left (\cos ^{5}\left (d x +c \right )\right )}{315}\right )}{d}\) | \(216\) |
norman | \(\frac {-\frac {35 a^{3} \left (\tan ^{15}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{96 d}+\frac {357 a^{3} x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{32}+\frac {4 a^{3} \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {1071 a^{3} x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64}+\frac {1071 a^{3} x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64}+\frac {537 a^{3} \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{32 d}+\frac {17 a^{3} x}{128}-\frac {124 a^{3}}{315 d}+\frac {153 a^{3} x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{32}+\frac {17 a^{3} x \left (\tan ^{18}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{128}-\frac {17 a^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{64 d}+\frac {153 a^{3} x \left (\tan ^{16}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{128}+\frac {153 a^{3} x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{128}-\frac {76 a^{3} \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{35 d}+\frac {357 a^{3} x \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{32}+\frac {153 a^{3} x \left (\tan ^{14}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{32}-\frac {531 a^{3} \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{32 d}-\frac {268 a^{3} \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5 d}-\frac {12 a^{3} \left (\tan ^{14}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {537 a^{3} \left (\tan ^{13}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{32 d}+\frac {35 a^{3} \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{96 d}-\frac {68 a^{3} \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}+\frac {531 a^{3} \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{32 d}-\frac {52 a^{3} \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{5 d}-\frac {124 a^{3} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{35 d}+\frac {17 a^{3} \left (\tan ^{17}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{9}}\) | \(468\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 138, normalized size = 0.87 \begin {gather*} -\frac {1024 \, {\left (35 \, \cos \left (d x + c\right )^{9} - 90 \, \cos \left (d x + c\right )^{7} + 63 \, \cos \left (d x + c\right )^{5}\right )} a^{3} - 27648 \, {\left (5 \, \cos \left (d x + c\right )^{7} - 7 \, \cos \left (d x + c\right )^{5}\right )} a^{3} - 1680 \, {\left (4 \, \sin \left (2 \, d x + 2 \, c\right )^{3} + 12 \, d x + 12 \, c - 3 \, \sin \left (4 \, d x + 4 \, c\right )\right )} a^{3} - 945 \, {\left (24 \, d x + 24 \, c + \sin \left (8 \, d x + 8 \, c\right ) - 8 \, \sin \left (4 \, d x + 4 \, c\right )\right )} a^{3}}{322560 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.39, size = 111, normalized size = 0.70 \begin {gather*} -\frac {4480 \, a^{3} \cos \left (d x + c\right )^{9} - 28800 \, a^{3} \cos \left (d x + c\right )^{7} + 32256 \, a^{3} \cos \left (d x + c\right )^{5} - 5355 \, a^{3} d x - 105 \, {\left (144 \, a^{3} \cos \left (d x + c\right )^{7} - 280 \, a^{3} \cos \left (d x + c\right )^{5} + 34 \, a^{3} \cos \left (d x + c\right )^{3} + 51 \, a^{3} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{40320 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 486 vs.
\(2 (151) = 302\).
time = 2.09, size = 486, normalized size = 3.06 \begin {gather*} \begin {cases} \frac {9 a^{3} x \sin ^{8}{\left (c + d x \right )}}{128} + \frac {9 a^{3} x \sin ^{6}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{32} + \frac {a^{3} x \sin ^{6}{\left (c + d x \right )}}{16} + \frac {27 a^{3} x \sin ^{4}{\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{64} + \frac {3 a^{3} x \sin ^{4}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{16} + \frac {9 a^{3} x \sin ^{2}{\left (c + d x \right )} \cos ^{6}{\left (c + d x \right )}}{32} + \frac {3 a^{3} x \sin ^{2}{\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{16} + \frac {9 a^{3} x \cos ^{8}{\left (c + d x \right )}}{128} + \frac {a^{3} x \cos ^{6}{\left (c + d x \right )}}{16} + \frac {9 a^{3} \sin ^{7}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{128 d} + \frac {33 a^{3} \sin ^{5}{\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{128 d} + \frac {a^{3} \sin ^{5}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{16 d} - \frac {a^{3} \sin ^{4}{\left (c + d x \right )} \cos ^{5}{\left (c + d x \right )}}{5 d} - \frac {33 a^{3} \sin ^{3}{\left (c + d x \right )} \cos ^{5}{\left (c + d x \right )}}{128 d} + \frac {a^{3} \sin ^{3}{\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{6 d} - \frac {4 a^{3} \sin ^{2}{\left (c + d x \right )} \cos ^{7}{\left (c + d x \right )}}{35 d} - \frac {3 a^{3} \sin ^{2}{\left (c + d x \right )} \cos ^{5}{\left (c + d x \right )}}{5 d} - \frac {9 a^{3} \sin {\left (c + d x \right )} \cos ^{7}{\left (c + d x \right )}}{128 d} - \frac {a^{3} \sin {\left (c + d x \right )} \cos ^{5}{\left (c + d x \right )}}{16 d} - \frac {8 a^{3} \cos ^{9}{\left (c + d x \right )}}{315 d} - \frac {6 a^{3} \cos ^{7}{\left (c + d x \right )}}{35 d} & \text {for}\: d \neq 0 \\x \left (a \sin {\left (c \right )} + a\right )^{3} \sin ^{2}{\left (c \right )} \cos ^{4}{\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.59, size = 157, normalized size = 0.99 \begin {gather*} \frac {17}{128} \, a^{3} x - \frac {a^{3} \cos \left (9 \, d x + 9 \, c\right )}{2304 \, d} + \frac {13 \, a^{3} \cos \left (7 \, d x + 7 \, c\right )}{1792 \, d} + \frac {a^{3} \cos \left (5 \, d x + 5 \, c\right )}{80 \, d} - \frac {5 \, a^{3} \cos \left (3 \, d x + 3 \, c\right )}{96 \, d} - \frac {21 \, a^{3} \cos \left (d x + c\right )}{128 \, d} + \frac {3 \, a^{3} \sin \left (8 \, d x + 8 \, c\right )}{1024 \, d} - \frac {a^{3} \sin \left (6 \, d x + 6 \, c\right )}{192 \, d} - \frac {5 \, a^{3} \sin \left (4 \, d x + 4 \, c\right )}{128 \, d} + \frac {a^{3} \sin \left (2 \, d x + 2 \, c\right )}{64 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 12.28, size = 437, normalized size = 2.75 \begin {gather*} \frac {17\,a^3\,x}{128}-\frac {\frac {17\,a^3\,\left (c+d\,x\right )}{128}-\frac {35\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{96}-\frac {537\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5}{32}+\frac {531\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7}{32}-\frac {531\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}}{32}+\frac {537\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{13}}{32}+\frac {35\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{15}}{96}-\frac {17\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{17}}{64}-\frac {a^3\,\left (5355\,c+5355\,d\,x-15872\right )}{40320}+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {153\,a^3\,\left (c+d\,x\right )}{128}-\frac {a^3\,\left (48195\,c+48195\,d\,x-142848\right )}{40320}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (\frac {153\,a^3\,\left (c+d\,x\right )}{32}-\frac {a^3\,\left (192780\,c+192780\,d\,x-87552\right )}{40320}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{14}\,\left (\frac {153\,a^3\,\left (c+d\,x\right )}{32}-\frac {a^3\,\left (192780\,c+192780\,d\,x-483840\right )}{40320}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (\frac {357\,a^3\,\left (c+d\,x\right )}{32}-\frac {a^3\,\left (449820\,c+449820\,d\,x-419328\right )}{40320}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}\,\left (\frac {1071\,a^3\,\left (c+d\,x\right )}{64}-\frac {a^3\,\left (674730\,c+674730\,d\,x+161280\right )}{40320}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}\,\left (\frac {357\,a^3\,\left (c+d\,x\right )}{32}-\frac {a^3\,\left (449820\,c+449820\,d\,x-913920\right )}{40320}\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,\left (\frac {1071\,a^3\,\left (c+d\,x\right )}{64}-\frac {a^3\,\left (674730\,c+674730\,d\,x-2161152\right )}{40320}\right )+\frac {17\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{64}}{d\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}^9} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________